// pages/showVital/group.js
let app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    library:1,
    list:[],
    menuTopList:[],
    operating:0,
    sign:0,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    if(options.libraryTab!=undefined){
      this.setData({library:options.libraryTab});
    }
    if(options.sign!=undefined){
      this.setData({sign:options.sign});
    }
  
  },

//请求统计接口
censusApi:function(){
  let params = {
    library: this.data.library,
    sign: this.data.sign,
  };
  app.request('post', '/api/statistics/censusApi', params).then(res => {
        this.setData({list:res.data.list,Industrial:res.data.Industrial,operating:res.data.operating});
  }).catch(err => console.log(err));
},

  //跳转项目列表
  showList:function(e){
    var sign =  this.data.sign;
    var library = this.data.library;
    var IndustrialChain = e.currentTarget.dataset.value;
    wx.navigateTo({ url: `/pages/showList/showList?libraryTab=${library}&sign=${sign}&IndustrialChain=${IndustrialChain}` })
  },

    //跳转项目列表
    signContract:function(e){
      var menuTop =  this.data.menuTop;
      var library = this.data.library;
      var keynote = this.data.keynote;
      var duty_unit = e.currentTarget.dataset.value;
      wx.navigateTo({ url: `/pages/showList/showList?libraryTab=${library}&keynote=${keynote}&menuTop=${menuTop}&duty_unit=${duty_unit}` })
    },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    this.censusApi();
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})